import { defineStore } from "pinia"

import { getOrderData } from '@/services'

const useOrderStore = defineStore("order", {
  state: () => ({
    orderData: []
  }),
  actions: {
    async fetchOrderData(type) {
      const res = await getOrderData(type)
      this.orderData = res.data.data.orders
    }
  }
})

export default useOrderStore